HA$PBExportHeader$u_cst_grid_bandejasalida.sru
forward
global type u_cst_grid_bandejasalida from u_cst_gridmain
end type
end forward

global type u_cst_grid_bandejasalida from u_cst_gridmain
event ue_reenviar ( )
event ue_finalizar ( )
event ue_viewdocu ( )
end type
global u_cst_grid_bandejasalida u_cst_grid_bandejasalida

type variables
integer ii_tabindex
datawindowchild dwc
end variables

event ue_reenviar();Long ll_count,ll_idorden,ll_orden[]
integer li_find_dw1,li_fila,li_find
string ls_boton,ls_titulo,ls_ordenes,ls_orden

// Get each of the selected
ll_orden = dw_1.Object.idorden.Current.Selected
// Find the number of selected items by finding the size of the array
ll_count = upperBound(ll_orden)

if ll_count <= 0 then
	return
end if
ls_ordenes = ''
for li_fila = 1 to ll_count
	ls_orden =string( ll_orden[li_fila])
	
	if li_fila  > 1  then
		ls_ordenes =ls_ordenes + ',' + ls_orden
	else
		ls_ordenes =ls_orden 
	end if
next
	ii_tabindex++
	ls_titulo = 'Reenviar Solicitud'// + ids_datastore.object.cdesc[1]
//		iou_powerdock.of_opendocument( iuo_userObject[ii_tabindex],istr_parm,ls_titulo ,ls_rutaMain,'u_cst_manto_main_cabedet')
//	istr_parm.long_parm[1] = 1
	istr_parm.string_parm[1] = ls_ordenes
	iou_powerdock.of_opendocument(  iuo_user[ii_tabindex],istr_parm,ls_titulo ,'InsertReturn!','u_cst_envio_mensajes')
	iou_powerdock.of_ActivateDocument(iuo_user[ii_tabindex])

//
//for li_fila = 1 to ll_count
//		
//	ll_idorden = ll_button[li_fila]
//	
//
//	if sqlca.Usp_Add_OSAC(ll_idorden,'4','E') <> 0 then 
//		RollBack;
//
//	End if		
//
//next
//commit;
//

end event

event ue_finalizar();Long ll_count,ll_idorden,ll_orden[]
integer li_find_dw1,li_fila,li_find
string ls_boton,ls_titulo,ls_ordenes,ls_orden,ls_iduser [],ls_usuarios,ls_user


ll_orden = dw_1.Object.idorden.Current.Selected
ls_iduser = dw_1.Object.iduser.Current.Selected

// Find the number of selected items by finding the size of the array
ll_count = upperBound(ll_orden)

if ll_count <= 0 then
	return
end if
ls_ordenes = ''
for li_fila = 1 to ll_count
	ls_orden =string( ll_orden[li_fila])
	
	if li_fila  > 1  then
		ls_ordenes =ls_ordenes + ',' + ls_orden
	else
		ls_ordenes =ls_orden 
	end if
next
 ls_usuarios=''
 dw_findoutput.dataobject = 'd_cadena_external'
ll_count = upperBound(ls_iduser)
for li_fila = 1 to ll_count
	ls_user =ls_iduser[li_fila]
	li_find = dw_findoutput.find('cadena = "'+ls_user+'"',1,dw_findoutput.rowcount())
	if li_find <> 0  then
		continue
	end if
	
	if li_fila  > 1  then
		ls_usuarios =ls_usuarios + ',' + ls_user
	else
		ls_usuarios =ls_user 
	end if
	dw_findoutput.scrolltorow(dw_findoutput.insertrow(0))
	dw_findoutput.object.cadena[dw_findoutput.rowcount()] =ls_user
next

	ii_tabindex++
	ls_titulo = 'Finalizar Solicitud'// + ids_datastore.object.cdesc[1]
	istr_parm.string_parm[1] = ls_ordenes
	istr_parm.string_parm[2] = ls_usuarios

	iou_powerdock.of_opendocument(  iuo_user[ii_tabindex],istr_parm,ls_titulo ,'InkPicture!','u_cst_reenviar_mensaje')
	iou_powerdock.of_ActivateDocument(iuo_user[ii_tabindex])


end event

event ue_viewdocu();Long ll_count,ll_idorden,ll_osac 
integer li_find_dw1,li_fila,li_find
string ls_boton,ls_titulo,ls_ordenes,ls_orden,ls_iduser [],ls_usuarios,ls_user,ls_osacs,ls_tipoMsj[],ls_tmsj,ls_fecha, ls_fechas

if dw_1.rowcount( ) <=0 then return


//ll_osac = dw_1.Object.idosac[dw_1.getrow()]
ll_idorden = dw_1.Object.idorden[dw_1.getrow()]

select top 1  idosac into :ll_osac from mosac where idorden = :ll_idorden and borigen = 1 and ttipo = 'O' ;
f_view_documento(ll_osac)
//of_view(ll_osac)


end event

on u_cst_grid_bandejasalida.create
call super::create
end on

on u_cst_grid_bandejasalida.destroy
call super::destroy
end on

event ue_refrescar;call super::ue_refrescar;dw_1.retrieve(gs_iduser);
commit;

end event

type dw_2 from u_cst_gridmain`dw_2 within u_cst_grid_bandejasalida
integer y = 1104
integer height = 1948
string dataobject = "d_msj_free"
boolean vscrollbar = true
end type

type st_por from u_cst_gridmain`st_por within u_cst_grid_bandejasalida
end type

type dw_1 from u_cst_gridmain`dw_1 within u_cst_grid_bandejasalida
string dataobject = "d_mosac_bandejasalida_grid"
end type

event dw_1::clicked;call super::clicked;string ls_tipomsj
if row<= 0 then return
ls_tipomsj = dw_1.object.tTipoMsj[row]
	
choose case ls_tipomsj	
	case 'X'
		dw_2.dataobject = 'd_msj_noconforme_free'
	case 'A'
		dw_2.dataobject = 'd_msj_anular_free'
	case 'N'
		dw_2.dataobject = 'd_mosac_free'
	case 'D'
		dw_2.dataobject = 'd_msj_free'
	case 'R'
		dw_2.dataobject = 'd_mosac_reenvio_free' //ditribucion o reenvio de mensajes para trabajos
	case 'F'
		dw_2.dataobject = 'd_msj_finalizar_free'
	case 'C'
		dw_2.dataobject = 'd_msj_conformidad_free'
	case	else 
		dw_2.dataobject = 'd_mosac_free'
end choose
dw_2.settransobject( sqlca)
dw_2.retrieve( dw_1.object.data[row,1])
dw_2.GetChild("idtiposoli", dwc);dwc.reset();	dwc.settransobject( sqlca);	dwc.retrieve( )
dw_2.GetChild("idcatesoli", dwc);dwc.reset();	dwc.settransobject( sqlca);	dwc.retrieve( )
dw_2.GetChild("idsoli", dwc);dwc.reset();	dwc.settransobject( sqlca);	dwc.retrieve( )
dw_2.GetChild("idarea", dwc);dwc.reset();	dwc.settransobject( sqlca);	dwc.retrieve( )
dw_2.GetChild("idgere", dwc);dwc.reset();	dwc.settransobject( sqlca);	dwc.retrieve( )
end event

type st_categoryname from u_cst_gridmain`st_categoryname within u_cst_grid_bandejasalida
end type

type ddlb_1 from u_cst_gridmain`ddlb_1 within u_cst_grid_bandejasalida
end type

type st_split from u_cst_gridmain`st_split within u_cst_grid_bandejasalida
long backcolor = 134217750
end type

type dw_findoutput from u_cst_gridmain`dw_findoutput within u_cst_grid_bandejasalida
end type

type pb_close from u_cst_gridmain`pb_close within u_cst_grid_bandejasalida
end type

type pb_prev from u_cst_gridmain`pb_prev within u_cst_grid_bandejasalida
end type

type pb_next from u_cst_gridmain`pb_next within u_cst_grid_bandejasalida
end type

type st_1 from u_cst_gridmain`st_1 within u_cst_grid_bandejasalida
end type

type st_find from u_cst_gridmain`st_find within u_cst_grid_bandejasalida
end type

type sle_text from u_cst_gridmain`sle_text within u_cst_grid_bandejasalida
end type

type cbx_matchcase from u_cst_gridmain`cbx_matchcase within u_cst_grid_bandejasalida
end type

type st_findback from u_cst_gridmain`st_findback within u_cst_grid_bandejasalida
end type

type cbx_output from u_cst_gridmain`cbx_output within u_cst_grid_bandejasalida
end type

type r_1 from u_cst_gridmain`r_1 within u_cst_grid_bandejasalida
end type

